package com.example.ware.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.ware.model.po.Declares;
import com.example.ware.model.vo.DeclareVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DeclareMapper extends BaseMapper<Declares> {


//    管理员与仓库专员的接口
//    获取列表
    public List<DeclareVo> getDelcareList(Integer status,String wid,String name, String cid,String sort,Integer pageNum, Integer pageSize,String id);

//    获取总数居
public List<DeclareVo>  getDelcareAll(Integer status, String wid,String name,String cid,String id);


//   员工方面接口
public List<DeclareVo>  getDelcareEmList(String start,String end,String name,Integer pageNum, Integer pageSize);
public List<DeclareVo>  getDelcareEmListAll(String start,String end,String name);




//根据id获取相应的数据
    @Select("  select `declares`.*, c.name as cname, w.name as wname, employees.username\n" +
            "        from `declares`\n" +
            "        left join employees ON\n" +
            "        `declares`.eid = employees.id\n" +
            "        inner join classify c on declares.cid = c.id\n" +
            "        inner join ware w on declares.wid = w.id where `declares`.id=#{id}")
    public DeclareVo getOne(String id);

}
